﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Animations;

namespace Silvermoon.UI 
{
    /// <summary>
    /// Every object that hosts PropertyAccessors is responsible to store animation data rather than the PropertyAccessor itself. Otherwise when a control is disposed, it would have to
    /// ensure that every PropertyTracking on every PropertyAccessor is deleted. Delegating this value to the object itself simplyfies that issue.
    /// </summary>
    public interface IPropertyObject
    {
        GroupTransitions GroupTransitions { get; set; }

        /// <summary>
        /// Gets the typed <see cref="PropertyTracking"/> for the specified <see cref="PropertyAccessor"/>, otherwise null.
        /// </summary>
        /// <param name="property">PropertyAccessor for which to get the value.</param>
        /// <returns>Typed PropertyValue, otherwise null.</returns>
        PropertyTracking GetPropertyTracking(PropertyAccessor property);

        /// <summary>
        /// Sets or removes a typed <see cref="PropertyTracking"/> for a <see cref="PropertyAccessor"/>.
        /// </summary>
        /// <param name="property">PropertyAccessor for which to set the value.</param>
        /// <param name="value">PropertyValue to set, or null to remove an existing PropertyValue.</param>
        void SetPropertyTracking(PropertyAccessor property, PropertyTracking value);

        void EnqueueAnimation(Animation animation);

        bool IsDisposing { get; }

        bool IsInitialized { get; }
    }
}
